Server Watch Plugin SDK Date: 6 Feb 2004
Release: 1.0
Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ISWPluginPane Class Reference

#include <ISWPluginPane.h>

List of all members.


Detailed Description

The ISWPluginPane interface defines a set of functions that, when a class inherits from and properly implements it, will expose the necessary functions functionality to Server Watch so that it can embed your pane into the Server Watch interface. We use the WTL CDialogImpl<> template as a base the windows in our plugins, but you could also use CWindow or CWnd as a base for your windows. This is an example of our CAdminTabDlg class implementing the ISWPluginPane interface in the header:

 class CAdminTabDlg : 
     public CDialogImpl<CAdminTabDlg>,
     public ISWPluginPane
 {
 public:
     CAdminTabDlg();
     ~CAdminTabDlg();

     enum { IDD = IDD_ADMINTABDLG };

     virtual const std::wstring& GetTitle() const;
     virtual DisplayMode GetDisplayMode() const;
     virtual HWND GetPaneHWND() const;
     virtual bool IsResizeable() const;
     virtual void PrePaneSelection();

     // Other elements of the class go here
     ...
 };

When this interface is properly implemented, your custom pane will be displayable in Server Watch along with the standard server panes like the users list, web output pane, etc.

We suggest that you create your panes in the LoadPlugin() process and destroy them during the UnloadPlugin() process of either the standard plugin interface or the plugin extender interface. To attach the panes to your server, call ISWServerData::InsertPane() during the InitServer() processing (you will not need to detach them).

You do not need to create an instance of the pane for each server created. The pane will recieve a special windows message (SWP_SET_DIALOG) each time that the pane is selected for display by the user. This message includes the SWPluginServerStruct associated to the server that you the pane should now handle.

You will need to implement a few Server Watch specific message handlers. The messages are defined in SWMessages.h along with the message values that Server Watch reserves as its own (don't reuse these values or you may have to make changes to your plugin as Server Watch revieves new enhancements in the future.

 BEGIN_MSG_MAP(CAdminTabDlg)
     MESSAGE_HANDLER(SWP_SET_DIALOG, OnSetDialog)
     MESSAGE_HANDLER(SWP_CHANGES_APPLIED, OnChangesApplied)
     MESSAGE_HANDLER(SWP_CHANGES_RESET, OnChangesReset)
 END_MSG_MAP()

 // This function is called whenever the pane is displayed to the user or when the
 // SWPluginServerStruct that is currently associated to the pane changes. The WPARAM
 // will be a pointer to the SWPluginServerStruct that you should use to display data.
 // The LPARAM will contain a value that indicates what triggered the call to this
 // function. See the "SWP_SET_DIALOG Mask" in SWMessages.h for the mask values.
 LRESULT OnSetDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

 // The apply button was pressed. You should save the values in the pane.
 LRESULT OnChangesApplied(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

 // The reset button was pressed. You should reset the values in the pane to their
 // previously saved state.
 LRESULT OnChangesReset(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

You must set the pane to have a style of WS_POPUP. Server Watch will change this style and parent it appropriately. If it does not start as WS_POPUP, Server Watch will fail to attach your pane. You should also turn off the border and title bar entirely. Leaving these on will not stop Server Watch from mounting the pane, but it won't look very good.

If you have a pane with settings, you will need to notify Server Watch when settings on the pane have changed so it can correctly enable and disable the apply and reset buttons. To do this, you send specific messages to the panes parent window. Read the "Message From Plugin Panes" section of SWMessages.h for a complete understanding of these messages. Because the pane will be reparented by Server Watch, it is critical that you call GetParent() for each message you inted to send to the parent window.


Public Types

enum  DisplayMode { DataOnly = 1, Settings = 2, DataApply = 3 }

Public Member Functions

virtual const std::wstring & GetTitle () const =0
virtual DisplayMode GetDisplayMode () const =0
virtual HWND GetPaneHWND () const =0
virtual bool IsResizeable () const =0
virtual void PrePaneSelection ()=0


Member Enumeration Documentation

enum ISWPluginPane::DisplayMode
 

The DisplayMode identifies information about the type of pane being handled. This information is used by Server Watch to identify the environment that should be presented when the pane is displayed for the pane to work correctly.

Enumeration values:
DataOnly  The pane doesn't need reset or apply buttons.
Settings  The pane is a settings dialog (needs reset and apply buttons).
DataApply  The is a data pane, but it needs reset and apply buttons.


Member Function Documentation

virtual const std::wstring& ISWPluginPane::GetTitle  )  const [pure virtual]
 

Returns:
The title that should be displayed for the pane

virtual DisplayMode ISWPluginPane::GetDisplayMode  )  const [pure virtual]
 

Returns:
The DisplayMode that identifies the pane type

virtual HWND ISWPluginPane::GetPaneHWND  )  const [pure virtual]
 

Returns the Windows GUI handle to the pane that will be hosted in Server Watch. This window should not have a parent (create it with a NULL parent) and it should have a style of WS_POPUP. When Server Watch ataches it to the primary window, the WS_POPUP style will be replaced with WS_CHILD and the pane will be parented to the appropriate window. This is critical to making your pane create and attach correctly.

Returns:
The HWND of the Windows pane itself.

virtual bool ISWPluginPane::IsResizeable  )  const [pure virtual]
 

Returns:
Whether your pane was designed to be resized or not.

virtual void ISWPluginPane::PrePaneSelection  )  [pure virtual]
 

Tells the pane it is about to be selected for display.

Deprecated:
Use the SWP_SET_DIALOG Windows message for this notification instead as it contains the SWPluginServerStruct that identifies the server that is associated to the new selection.


The documentation for this class was generated from the following file:

Copyright (c) 2003-2004, Deep Fried Software. All rights reserved.